﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MP.master" AutoEventWireup="true"
    ValidateRequest="false"
    CodeFile="Edit.aspx.cs" Inherits="WebService_Edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MP1" runat="Server">
    <%if (string.IsNullOrEmpty(Codes))
      { %>
    <link href="<%=ResolveClientUrl("~") %>/themes/skin-<%=GetTogether.Studio.Config.Original.Skin %>/dtree.css?v=<%=GetTogether.Studio.Config.Original.ScriptStyleVersion %>"
        rel="stylesheet" type="text/css" />
    <div style="padding-bottom: 1px;">
        <%=Parameter.Category %><span class="mm-split">|</span>
        <%=Parameter.ProjectName%><span class="mm-split">|</span>
        <a href="javascript:;;" class="a-btn" style="cursor: pointer;" onclick="AjaxMsg('Edit / Create project',null,null,SerUrl,'WebService/Callback/Projects.aspx?type=2&amp;pn=<%=Parameter.ProjectName %>&amp;get=1','',null,23);">
                                Edit</a><span class="mm-split">|</span><a class="a-btn"
                                href="<%=string.IsNullOrEmpty(Parameter.WsdlAddress)?string.Concat(Parameter.Address,Parameter.Address.IndexOf("?")>0?"&":"?","WSDL"):Parameter.WsdlAddress %>" target="_blank">WSDL</a>
                        <span class="mm-split">|</span><a class="a-btn" href="Edit.aspx?pn=<%=Request["pn"] %>&gc=1"
                            target="_blank">Code</a>

    </div>
    <div id="nav-container">
        <ul id="nav-list">
            <li id="active" onclick="ft(this);" class="web-service-invoke"><a href="javascript:;;">Service Invoke</a></li>
            <li onclick="WebServiceFocusProxy(this);" class="web-service-proxy"><a href="javascript:;;">Service Proxy</a> </li>
        </ul>
        <div class="line-sub"></div>
    </div>
    <div id="edit-content">
        <div id="dv-web-service-invoke" class="tab">
            <div id="dv-table-web-service">
                <div style="float: left; width: <%=CurrentSession.IsFromSchedule?"35":"25"%>%;">
                    <div class="box-option">
                        <a class="a-btn"
                            href="javascript:;;" onclick="GetWebMethod(true);">Refresh</a>
                        
                    </div>
                    <div class="box">
                        
                        <div style="padding:2px;">
                            <a href="<%=Parameter.Address %>" target="_blank"><%=Parameter.Address.Replace("/","/ ").Replace("/ /","//")%></a>
                        
                        </div>
<%--                        <div class="line-sub"></div>
                        <textarea rows="5" id="web-service-address" style="height:18px;margin:0px;padding:0px;border:none;width:100%;"><%=Parameter.Address %></textarea>--%>
                    </div>

                    <div id="dv-web-methods" style="min-height: 100px; margin-top: 5px;">
                        <div id="dv-web-methods-default">
                        </div>
                    </div>
                </div>
                <div style="width: <%=CurrentSession.IsFromSchedule?"65":"75"%>%; float: right;">
                    <div style="margin: 0px 0px 5px 5px;" id="dv-web-service-content">
                        <div class="box-option">
                            Request&nbsp;(Double click on the textarea to enlarge)
                        </div>
                        <div class="box">
                            <div id="dv-web-method-info">
                                <div style="min-height: 100px;">
                                </div>
                            </div>
                        </div>
                        <div class="box-option" style="margin-top: 5px;">
                            Response&nbsp;(Double click on the textarea to enlarge)
                        </div>
                        <div class="box">
                            <div id="dv-web-method-result">
                                <div style="min-height: 100px;">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" id="init-history" />
            <input type="hidden" id="init-method" />
        </div>
        <div id="dv-web-service-proxy" class="tab" style="display: none;">
            <div style="float: left; width: <%=CurrentSession.IsFromSchedule?"35":"25"%>%;">
                <div class="box-option">
                     <a class="a-btn"
                            href="javascript:;;" onclick="GetWebMethod(false,true);">Refresh</a>&nbsp;<%if(Parameter.Proxy!=null && Parameter.Proxy.EnableCache){ %>(Cache Enabled)<%} %>
                    
                </div>
                <div class="box">
                    <div style="padding:2px;">
                        <a target="_blank" href="<%=GetProxyAddress() %>"><%=GetProxyAddress().Replace("/","/ ").Replace("/ /","//") %></a>
                    </div>
                </div>
                    <div id="dv-web-methods-proxy" style="min-height: 100px; margin-top: 5px;">
                        <div id="dv-web-methods-default-proxy">
                        </div>
                    </div>
            </div>
            <div style="width: <%=CurrentSession.IsFromSchedule?"65":"75"%>%; float: right;">

                <div style="margin: 0px 0px 5px 5px;" id="dv-web-service-proxy-content">
                    <div class="box-option">
                        Proxy&nbsp;(Double click on the textarea to enlarge)
                    </div>
                    <div class="box">
                        <div id="dv-web-method-proxy-history">
                            <div style="min-height: 100px;">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <%}
      else
      { %>
    <div class="box">
        <textarea id="txt-codes" rows="50" style="width: 100%;"><%=Codes %></textarea>
    </div>
    <%} %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptPlaceHolder" runat="Server">
    <%if (string.IsNullOrEmpty(Codes))
      { %>
    <script src="<%=ResolveClientUrl("~") %>js/dtree.js?v=<%=GetTogether.Studio.Config.Original.ScriptStyleVersion %>"
        type="text/javascript"></script>
    <script src="<%=ResolveClientUrl("~") %>js/web-service.js?v=<%=GetTogether.Studio.Config.Original.ScriptStyleVersion %>"
        type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        var FVersion = '';
        var ProjectName = '<%=Request["pn"] %>';
        var ProjectCategory = '<%=GetTogether.Studio.ProjectParameter.ProjectCategory.WebService%>';
        $(document).ready(function () {
            $('#init-history').val(getUrlParam('history'));
            $('#init-method').val(getUrlParam('method'));
            GetWebMethod(false);
            EnhanceTextarea('web-service-address');
        });
    </script>
    <%}
      else
      { %>
    <script language="javascript" type="text/javascript">
        EnhanceTextarea('txt-codes');
        $('#txt-codes').css('height', $(window).height() - 45 + 'px');
    </script>
    <%} %>
</asp:Content>
